
           Dynamic Programming vs. Divide and Conquer

Both "dynamic programming" and "divide and conquer" use recurrence relations. But there is a major difference in the role that recurrence relations play.

In divide and conquer, the recurrence relation is not the problem that we are trying to solve. The recurrence relation is a tool that we use to analyze our (recursive) solution to a problem. Given a (recursive) solution to our problem, we derive a recurrence relation for the running time of the algorithm. The solution of the recurrence relation is then the running time of our solution to the problem. (Also, the solution to the recurrence relation is more often than not given as a Big O complexity class. We usually don't even know an exact solution to the recurrence relation.)

In dynamic programming, the recurrence relation IS the problem that we are trying to solve. In dynamic programming, we solve a problem by translating the problem into a recurrence relation and then computing an exact(!) solution to the recurrence relation (not a complexity class, or Big O, solution). The solution to the recurrence relation is the solution to the problem (and this solution is not the running time of our algorithm).

When we solve a problem using "dynamic programming", we translate the problem into a recurrence relation and then we choose a method for computing this recurrence relation. We usually DO NOT compute the recurrence relation by using recursion, since that would, usually, lead to very long running times. More often than not, we compute the recurrence relation by filling in the entries in a table. The complexity of a dynamic programming algorithm is usually determined by the dimensions of this table (since the dimensions determine how many entries in the table we need to compute). The dimensions of this table are determined by the recurrence relation, but they are not determined by the solution of the recurrence relation. The dimensions of this table are determined by the "structure" of the recurrence relation.
